]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/bluetooth: Ignore devices when turned off
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 23 Feb 2023 18:03:38 +0000 (19:03 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 24 Feb 2023 15:46:45 +0000 (15:46 +0000)
gnome-bluetooth clears the list of devices when the adapter goes
away, but we cannot assume that that'll happen when powered down.

We don't want to show a (potentially outdated) list of devices
that cannot be interacted with in that case, so explicitly check
for the active state when returning devices.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2658>

js/ui/status/bluetooth.js

index ca250dd4502e74a2845d931a087efe73aef741e8..a5d6451ca703f1a3d59dcfa25acfaa3abbbe468f 100644 (file)
@@ -134,6 +134,10 @@ const BtClient = GObject.registerClass({
     }
 
     *getDevices() {
+        // Ignore any lingering device references when turned off
+        if (!this.active)
+            return;
+
         const deviceStore = this._client.get_devices();
 
         for (let i = 0; i < deviceStore.get_n_items(); i++) {